package com.example.testljsstarter.test.controller;

import com.example.testljsstarter.test.annotaion.Ljs;
import com.ljs.ljsstarter.constant.StarterService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Arrays;

@RestController
public class GetController {

    @Resource
    StarterService starterService;
    @GetMapping("/getStarterService")
    public String getStarterService(){
        System.out.println("starter获取的值"+starterService.getConfig());
        System.out.println("截取的值"+ Arrays.toString(starterService.split(",")));
        return Arrays.toString(starterService.split(","));
    }
    @Value("${env}")
    String env;
    @GetMapping("/getEnv")
    public String getEnv(){
        return "获取启动参数的值"+env;

    }
@Ljs
    @GetMapping("/testLjs")
    public String testLjs(@RequestParam("name") String name){
        return "测试注解"+name;
    }
}
